﻿using Abp.Authorization;
using Abp.Localization;
using Abp.Notifications;
using Partner.Surround.Authorization;
using System;
using System.Collections.Generic;
using System.Text;

namespace Partner.Surround.Notifications
{
    /// <summary>
    /// 通知定义
    /// </summary>
    public class AppNotificationProvider : NotificationProvider
    {
        /// <summary>
        /// 设置通知定义
        /// </summary>
        /// <param name="context"></param>
        public override void SetNotifications(INotificationDefinitionContext context)
        {
            #region 任务提醒
            context.Manager.Add(
                new NotificationDefinition(
                    AppNotificationNames.NewTask,
                    displayName: L("NewTask"),
                    permissionDependency: new SimplePermissionDependency(PermissionNames.Pages_TaskManage)
                )
            );
            #endregion
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, SurroundConsts.LocalizationSourceName);
        }
    }
}
